/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gr.anagnosg.general.utils.text;

import gr.anagnosg.general.utils.diff_match_patch;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author anagnosg
 */
public class TextCorrection {
    public TextCompare tco =null;
    
    public static HashMap textActions2Correct(TextCompare tco){
        HashMap hm = new HashMap();
        int correctionResult=0;
        int compareResult = tco.getCompareResult();
        
        if(compareResult==0){//einai ola idia. 
            //den kano tipota.
            correctionResult=0;
        }
        else if(compareResult==1){//idia ola alla oxi oi xarakthres.
            //apla 8a xrhsimopoihso to source gia na fteiakso to box.
            correctionResult=1;        }
        hm.put("result", correctionResult);
        return hm;
    }
    
    
    public static void correctBoxFileSameLettersCount(TextCompare tco, List boxData){
        /*
        diff_match_patch.Diff dT = diffList.get(i);
        if(dT.text.equals("\n") && (dT.operation+"").equals("DELETE") ){
            diffList.remove();
        }
        else if((dT.operation+"").equals("DELETE")){
            String textT = dT.text;
            //System.out.println("("+textT+")"+",length:"+textT.length());
            //StringUtils.printStringChars(textT);
            //System.out.println(i+","+dT.text+","+dT.operation);  
            //diff_match_patch.Diff dTIn = list.get(i+1);
           // System.out.println(i+","+dT.text+","+dT.operation+","+dTIn.text+", "+dTIn.operation);  
        }
        */
        /*LinkedList<diff_match_patch.Diff> dfList = tco.getDiffList();
        
        for(int i = 0 ; i < dfList.size(); i++){
            diff_match_patch.Diff df = dfList.get(i);
        
        }*/
        
        //to s2 einai to source.
        
        
    }
}
